package com.electronic.enums;

import lombok.Getter;

/**
 * 印章类型
 *
 * @author zyh 
 * ================================
 * Date: 2024/9/27
 * Time: 上午9:22
 * ================================
 */
@Getter
public enum SealTypeEnum {

    T_00("00", "手写签名", 113, 57),
    T_01("01", "公章", 113, 113),
    T_02("02", "合同章", 113, 113),
    T_03("03", "财务章", 85, 85),
    T_04("04", "人名章", 57, 57),
    T_05("05", "法定代表人章", 57, 57),
    T_06("06", "人名章/法定代表人", 57, 57),
    T_07("07", "人名章长方形", 40, 14),
    T_08("08", "手绘人名章", 113, 57),
    ;

    private String type;

    private String desc;
    /**
     * 约束宽度(px)
     */
    private int widthPx;
    /**
     * 约束高度(px)
     * 0代表使用默认高度
     */
    private int heightPx;

    SealTypeEnum(String type, String desc, int widthPx, int heightPx) {
        this.type = type;
        this.desc = desc;
        this.widthPx = widthPx;
        this.heightPx = heightPx;
    }

    public static SealTypeEnum getByType(String type) {
        for (SealTypeEnum typeEnum : SealTypeEnum.values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }


}